<template>
  <yd-grids-group :rows="3" title="菜单">
    <yd-grids-item v-for="menu in menus" :key="menu.index" @click.native="clickmenu(menu.path)">
      <hd-svg-icon name='hd-jifen' color='#004bff' size='.55rem' slot="icon"/>
      <span slot="text">{{menu.name}}</span>
    </yd-grids-item>
  </yd-grids-group>
</template>

<script>
export default {
  name: 'homeIndex',
  data () {
    return {
      menus: [
        {
          index: 1,
          name: 'demo',
          path: '/demo'
        },
        {
          index: 2,
          name: '菜单2',
          path: '/'
        },
        {
          index: 3,
          name: '菜单3',
          path: '/'
        },
        {
          index: 4,
          name: '菜单4',
          path: '/'
        }
      ]
    }
  },
  methods: {
    clickmenu (router) {
      this.$router.push(router)
      console.log(window.location.href);
    }
  }
}
</script>

<style lang="stylus" scoped>

</style>

